function navigator(url){
	uni.navigateTo({
		url:url,
		animationType: 'pop-in',
		animationDuration: 300
	})
}

function call(res){
	uni.makePhoneCall({
				phoneNumber:res, //电话号码
				success: function(e) {
					console.log(e);
				},
				fail: function(e) {
					console.log(e);
				}
			})
}

function setStorage(name,data){
	uni.setStorage({
		key:name,//对应要修改的键名
		data:data,//修改的数据会覆盖之前键名对应的数据
		success(res){
			return res;
			console.log(res)
		}
	})
}

function removeAge(name){
	uni.removeStorage({//通过key（键值名）来删除对应数据
		key:name,
		success(res) {
			return res;
			console.log(res)
		}
	})
}


function ClearStorage(){
	uni.clearStorage();//清空所有数据
}

function getStorages(name){
	 const data = uni.getStorageSync(name);
	 return data;
}

function showToast(msg){
	uni.showToast({
	       title: msg,
	       icon: 'none',
	       duration: 2000,
	   })
}

export{
	navigator,
	call,
	getStorages,
	showToast,
	removeAge,
	ClearStorage,
	setStorage
	}